package com.webware.one.shared.dto;

@SuppressWarnings("serial")
public abstract class EntityDto implements IDto {
  private Long id;

  public EntityDto() {
    super();
  }

  public EntityDto(Long id) {
    super();
    this.id = id;
  }

  @Override
  public boolean equals(Object obj) {
    if (obj == null) return false;
    if (obj.getClass().getName() != this.getClass().getName()) return false;
    if (this.getId() == null && ((EntityDto) obj).getId() == null)
      return super.equals(obj);
    else
      return ((EntityDto) obj).getId().equals(this.getId());
  }

  public void setId(Long id) {
    this.id = id;
  }

  public Long getId() {
    return id;
  }

}
